package ${packageName}.domain;

import  ${packageName}.listener.${listenerName};
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * ${remark}实体类
 * @Author: 不是菜鸡爱编程
 * @Date:
 * @Description：
 */
@Table(value = "${tableName}",
    onInsert = ${listenerName}.class,
    onUpdate = ${listenerName}.class
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "${entityName}",description = "${remark}")
public class ${entityName} implements Serializable {
    <#if columns??>
        <#list columns as column>
            <#if column.type='VARCHAR'||column.type='TEXT'||column.type='CHAR'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    private String ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='INT'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    private Integer ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='DATE'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='DATETIME'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='BIGINT'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    private Long ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='DECIMAL'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    private Double ${column.propertyName?uncap_first};
            </#if>
            <#if column.type='BIT'>
    /**
     * ${column.remark}
     */
    <#if column.isPrimary=true>
    @Id(keyType = KeyType.Auto)
    </#if>
    @ApiModelProperty("${column.remark}")
    private Boolean ${column.propertyName?uncap_first};
            </#if>
        </#list>
    </#if>
}